package com.example.androiddev.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.androiddev.R;
import com.example.httplib.bean.Person;

import java.util.List;

/**
 * Created by zxw.
 * CreateDate: 2019/12/19 13:52
 * Description: 页面描述
 */
public class PersonAdapter extends BaseQuickAdapter<Person, BaseViewHolder> {

    public PersonAdapter(List<Person> data) {
        super(R.layout.person_item_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, Person person) {
        baseViewHolder.setText(R.id.age, person.getAge())
                .setText(R.id.name, person.getName());
        baseViewHolder.addOnClickListener(R.id.age);
        baseViewHolder.addOnClickListener(R.id.name);
    }

}
